﻿var config = {
    requiedJsFile: [
        "XWorkflow/XWFRenderView.js",
        "XWorkflow/XWFPropertiesView.js",
        "XWorkflow/XWFRenderView.js",
        "XWorkflow/XWFStatusView.js",
        "XWorkflow/XWFToolbarView.js",
        "XWorkflow/XWFToolboxView.js"
    ],
    template: [
        { key: "Properties", val: "../Templates/XWFProperty.html" },
        { key: "Status", val: "../Templates/XWFStatus.html" },
        { key: "Toolbar", val: "../Templates/XWFToolbar.html" },
        { key: "Toolbox", val: "../Templates/XWFToolbox.html" },
        { key: "SvgView", val: "" },
    ],
    getTemplateByKey: function (key) {
        for (var i = 0; i < this.template.length; i++) {
            if (this.template[i].key == key) {
                return this.template[i].val
            }
        }
        return "";
    },
    requied: function (src) {
        var oHead = document.getElementsByTagName('HEAD').item(0);
        var oScript = document.createElement("script");
        oScript.src = src;
        oHead.appendChild(oScript);
    }
}

//加载所有视图脚本
for (var i = 0; i < config.requiedJsFile.length; i++) {
    config.requied(config.requiedJsFile[i]);
}